<template>
    <div class='main-wrap'>
        <el-container style="height:100vh">
            <el-header style=" font-size: 12px">
                <div style="float:left">复习工具1.0</div>
                <!--<el-dropdown style="float:right">-->
                <!--<i class="el-icon-setting"></i>-->
                <!--<el-dropdown-menu slot="dropdown">-->
                <!--<el-dropdown-item>查看</el-dropdown-item>-->
                <!--<el-dropdown-item>新增</el-dropdown-item>-->
                <!--<el-dropdown-item>删除</el-dropdown-item>-->
                <!--</el-dropdown-menu>-->
                <!--</el-dropdown>-->
                <!--<span style="float:right">charles</span>-->
                <el-dropdown  style="float:right" trigger="click"  >
                  <span class="el-dropdown-link">
                    菜单<i class="el-icon-arrow-down el-icon--right"></i>
                  </span>
                    <el-dropdown-menu slot="dropdown"  >
                        <!--<el-dropdown-item icon="el-icon-plus">关闭</el-dropdown-item>-->
                        <el-dropdown-item icon="el-icon-plus">帮助</el-dropdown-item>
                        <!--<el-dropdown-item icon="el-icon-plus">螺蛳粉</el-dropdown-item>-->
                        <!--<el-dropdown-item disabled>双皮奶</el-dropdown-item>-->
                        <!--<el-dropdown-item divided icon="el-icon-plus" >蚵仔煎</el-dropdown-item>-->
                    </el-dropdown-menu>
                </el-dropdown>


            </el-header>
            <el-container>

                <el-container>
                    <el-aside width="200px">
                        <el-menu :default-openeds="['1']">
                            <el-submenu index="1">
                                <template slot="title"><i class="el-icon-message"></i>笔记管理</template>
                                <el-menu-item-group>
                                    <!--<template slot="title">分组一</template>-->
                                    <el-menu-item index="1-1">
                                        <div v-on:click="openCreateNote">创建新笔记</div>
                                    </el-menu-item>
                                    <el-menu-item index="1-1">
                                        <div v-on:click="openNoteTable">笔记列表</div>
                                    </el-menu-item>
                                </el-menu-item-group>
                                <!--<el-menu-item-group title="复习模式">-->
                                    <!--<el-menu-item index="1-3">选项3</el-menu-item>-->
                                <!--</el-menu-item-group>-->
                                <el-submenu index="1-4">
                                    <template slot="title">模式设置</template>
                                    <el-menu-item index="1-4-1">模式设置</el-menu-item>
                                </el-submenu>
                            </el-submenu>
                            <el-submenu index="2">
                                <template slot="title"><i class="el-icon-menu"></i>快捷工具</template>
                                <el-menu-item-group>
                                    <!--<template slot="title">分组一</template>-->
                                    <el-menu-item index="2-1">开发文档</el-menu-item>
                                    <el-menu-item index="2-2">任务</el-menu-item>
                                </el-menu-item-group>
                                <!--<el-menu-item-group title="分组2">-->
                                    <!--<el-menu-item index="2-3">选项3</el-menu-item>-->
                                <!--</el-menu-item-group>-->
                                <!--<el-submenu index="2-4">-->
                                    <!--<template slot="title">选项4</template>-->
                                    <!--<el-menu-item index="2-4-1">选项4-1</el-menu-item>-->
                                <!--</el-submenu>-->
                            </el-submenu>
                            <!--<el-submenu index="3">-->
                                <!--<template slot="title"><i class="el-icon-setting"></i>导航三</template>-->
                                <!--<el-menu-item-group>-->
                                    <!--<template slot="title">分组一</template>-->
                                    <!--<el-menu-item index="3-1">选项1</el-menu-item>-->
                                    <!--<el-menu-item index="3-2">选项2</el-menu-item>-->
                                <!--</el-menu-item-group>-->
                                <!--<el-menu-item-group title="分组2">-->
                                    <!--<el-menu-item index="3-3">选项3</el-menu-item>-->
                                <!--</el-menu-item-group>-->
                                <!--<el-submenu index="3-4">-->
                                    <!--<template slot="title">选项4</template>-->
                                    <!--<el-menu-item index="3-4-1">选项4-1</el-menu-item>-->
                                <!--</el-submenu>-->
                            <!--</el-submenu>-->
                        </el-menu>


                    </el-aside>
                    <el-main style='overflow-x: hidden;'>
                        <!-- 路由出口 -->
                        <!-- 路由匹配到的组件将渲染在这里 -->
                        <router-view></router-view>
                    </el-main>
                </el-container>
                <!--<el-footer>Footer</el-footer>-->
            </el-container>
        </el-container>
    </div>
</template>

<script>
    import CreateNewNote from './views/CreateNewNote'
    import NoteTable from './views/NoteTable'
    import Header from './MainPage/Header'


    export default {
        name: 'MainPage',
        components: {Header ,CreateNewNote ,NoteTable },
        methods: {
            open(link) {
                this.$electron.shell.openExternal(link)
            },
            test() {
                alert();
            },
            openCreateNote(){
                this.$router.push({ path: `/main-page/create-note` })
            },
            openNoteTable(){
                this.$router.push({ path: `/main-page/note-table` })
            }
        },
        data() {
            const item = {
                date: '2016-05-02',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1518 弄'
            };
            return {
                tableData: Array(3).fill(item)
            }
        }
    }
</script>


<style>
    .main-wrap {
        min-width: 300px;
        height: 100vh;
    }

    .el-header, .el-footer {
        background-color: #aed1ff;
        color: #333;
        /*text-align: center;*/
        line-height: 60px;
        height: 50px;
    }

    .el-aside {
        /*background-color: #D3DCE6;*/
        color: #333;
        text-align: center;
        line-height: 200px;
    }


    .el-main {
        background-color: #ded9f9;
        color: #333;
        /*text-align: center;*/
        /*line-height: 160px;*/

    }

    body > .el-container {
        margin-bottom: 40px;
    }

    .el-container:nth-child(5) .el-aside,
    .el-container:nth-child(6) .el-aside {
        line-height: 260px;
    }

    .el-container:nth-child(7) .el-aside {
        line-height: 320px;
    }
</style>